<html>
<head>
<script src="../js/valid.js" type="text/javascript" ></script>
<link href = "../css/border_style_rounded.css" type = "text/css" rel = "stylesheet" />
</head>
</html>
<?
	include "../db.php";
	session_start();

	if(isset($_GET['username']))
		$username = $_GET['username'];

	$query = "select * from login where username = '$username'";
	$result = mysql_query($query);

	if($result)
	{
		$rows = mysql_fetch_assoc($result);
		$category = $rows['category'];
		$query_category = "select * from $category where username = '$username'";
		$result_category = mysql_query($query_category);
		if($result_category)
		{
			
				$rows_category = mysql_fetch_assoc($result_category);
				$img = $rows_category['image'];
				if($img == "")
					$img = "../img/noimg.jpg";
				echo "
				<div class='divTable'>
            				<div class='divRow'>
					        <div class='divCell_info'>Avatar : </div>
						<img src = '$img' height = '100' width = '100'></img>
					</div>
				        <div class='headRow'>
        				        <div class='divCell_info'>Username : </div>
        				        <div class='divCell_input'>".$rows_category['username']."</div>
        				</div>
		            		<div class='divRow'>
        				        <div class='divCell_info'>Email : </div>
        				        <div class='divCell_input'>".$rows_category['email']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Password : </div>
        				        <div class='divCell_input'>".$rows_category['password']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Full Name : </div>
        				        <div class='divCell_input'>".$rows_category['name']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Date of Birth : </div>
        				        <div class='divCell_input'>".$rows_category['dob']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Address : </div>
        				        <div class='divCell_input'>".$rows_category['address']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>City : </div>
        				        <div class='divCell_input'>".$rows_category['city']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>State : </div>
        				        <div class='divCell_input'>".$rows_category['state']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Contact : </div>
        				        <div class='divCell_input'>".$rows_category['contact']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Website/Blog : </div>
        				        <div class='divCell_input'>".$rows_category['web_page']."</div>
        				</div>
            				<div class='divRow'>
        				        <div class='divCell_info'>Experience : </div>
        				        <div class='divCell_input'>".$rows_category['experience']."</div>
        				</div>
				</div>				";

		}
		else
			echo mysql_error()."1";
	}
	else
		echo mysql_error()."2";

?>
